package com.xiay.stringboot.controller;


import com.xiay.stringboot.config.StudentConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

/**
 * Created by H-209-FX-XY on 2018/3/20.
 */
@Controller
public class HelloController {
    @Value("${base-url}")
    private String baseUrl ;

    @Autowired
    private StudentConfig studentConfig;

    @GetMapping(value = "/hello")
    @ResponseBody
    public StudentConfig hello(){
        return studentConfig;
    }
    @GetMapping(value = "/helloworld")
    public String helloworld(ModelMap modelMap){
        modelMap.addAttribute("studentConfig",studentConfig);
        return "helloworld";
    }
}
